﻿using SlamDunk.ValueObjects.Enums;
using System;

namespace SlamDunk.MES.DataDrive.Bussiness.Models.ConfigurationContext
{
    /// <summary>
    /// 硬件
    /// </summary>
    public class Hardware
    {
        public string 硬件类型 { get; set; }
        public string 硬件名称 { get; set; }
        public string 硬件编号 { get; set; }
        public string 型号 { get; set; }
        public string 备注 { get; set; }
        internal HardwareType HardwareType { get; set; }
        public void ConverterValue()
        {
            if (!string.IsNullOrWhiteSpace(this.硬件类型))
            {
                this.HardwareType = (HardwareType)Enum.Parse(typeof(HardwareType), this.硬件类型.Substring(0, this.硬件类型.IndexOf("(", StringComparison.Ordinal)));
            }
        }
    }
}
